Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(examples): use tokio instead of async-std in relay-server #5600

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

P1R
Copy link
Contributor

@P1R P1R commented Sep 17, 2024

Description

Following on issue #4449
refactor: use tokio instead of async-std in the relay-servert example and remove unnecessary dependencies

Notes & open questions

Fails on testing with the whole punch tutorial possibly because of my networking topology. connection established event registered.

I will publish the logs and testing information as a comment

Change checklist

  • Removed unnecessary dependencies on examples/relay-server/Cargo.toml
  • Updated tokio version to "1.37.0"
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@P1R
Copy link
Contributor Author

P1R commented Sep 17, 2024

Issue 4449 relay-server (examples)

#4449

Code review and tests

the current PR

  • Refactor: use tokio instead of async-std in the relay-server example
  • Remove the block_on from futures::executor
  • Setup relay-server with open tcp port on 4001 at
  • Test libp2p-lookup
  • Test whole punching

Whole punching

Status: Cannot stablish the whole punching
Error: Outgoing Connection Failed: Timeout has been reached

Network Topology

The network topology used in this setup involves three key nodes:

  • Relay Server (/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN),
    running in an Incus container with port forwarding enabled.

  • Listening Client (/ip4/10.162.235.31/tcp/36521/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X),
    also running in an Incus container behind NAT using the same server that hosts the relay server (on a private IP address).

  • Dialing Client (/ip4/192.168.1.150/tcp/42045/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3),
    running on a separate device behind a NAT.

Key Observations:

  • Relay server has public access and forwards connections on port 4001.
  • Listening client is behind NAT in an Incus container on the same LAN as the relay.
  • Dialing client attempts direct connectivity to the listening node using a relay but struggles due to timeouts.

Problem:

Hole punching isn't successfully establishing between the listening and dialing clients. Timeouts are being hit while trying to negotiate transport protocols over the relay.

Relay Server

Multiaddress: /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

Executed command

./relay-server-example --port 4001 --secret-key-seed 0

Notice: the relay server is running in an incus container where the iptables
of the main server with the public ip address redirect the 4001 tcp in bouth
directions (forwarding enable).

Logs

p1r0@libp2p:~/rust-libp2p-bare/relay-server-example/target/debug$ ./relay-server-example --port 4001 --secret-key-seed 0
Listening on "/ip4/127.0.0.1/tcp/4001"
Listening on "/ip4/10.162.235.39/tcp/4001"
Listening on "/ip4/127.0.0.1/udp/4001/quic-v1"
Listening on "/ip4/10.162.235.39/udp/4001/quic-v1"
BehaviourEvent: Sent { connection_id: ConnectionId(1), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
BehaviourEvent: Received { connection_id: ConnectionId(1), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): cecc157dc1ddd7295951c29888f095adb944d1b73d696e6df65d683bd4fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/127.0.0.1/udp/39912/quic-v1", "/ip4/10.162.235.31/tcp/36521", "/ip4/127.0.0.1/tcp/36521", "/ip4/10.162.235.31/udp/39912/quic-v1"], protocols: ["/libp2p/circuit/relay/0.2.0/stop", "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0", "/ipfs/ping/1.0.0"], observed_addr: "/ip4/10.162.235.39/tcp/4001" } }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.550565ms) }
BehaviourEvent: ReservationReqAccepted { src_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), renewed: false }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.472772ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.874097ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(2.331323ms) }
BehaviourEvent: Sent { connection_id: ConnectionId(3), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3") }
BehaviourEvent: Received { connection_id: ConnectionId(3), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 6b79c57e6a95239282c4818e96112f3f3a401ba97a564c23852a3f1ea5fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/127.0.0.1/tcp/42045", "/ip4/192.168.122.1/tcp/42045", "/ip4/192.168.122.1/udp/56226/quic-v1", "/ip4/192.168.1.150/tcp/42045", "/ip4/192.168.1.150/udp/56226/quic-v1", "/ip4/127.0.0.1/udp/56226/quic-v1"], protocols: ["/ipfs/id/1.0.0", "/ipfs/id/push/1.0.0", "/ipfs/ping/1.0.0", "/libp2p/circuit/relay/0.2.0/stop"], observed_addr: "/ip4/66.29.128.144/tcp/4001" } }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(3), result: Ok(300.63699ms) }
BehaviourEvent: CircuitReqAccepted { src_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), dst_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.357739ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(3), result: Ok(599.426206ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.850532ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(3), result: Ok(81.035919ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.396456ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(3), result: Ok(144.138389ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.365213ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(3), result: Ok(75.182587ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.865604ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(3), result: Ok(147.051367ms) }
BehaviourEvent: CircuitClosed { src_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), dst_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), error: None }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(949.996µs) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.66916ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(1.713821ms) }

Listening Client

Multiaddress: /ip4/10.162.235.31/tcp/33887/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6Xe4

Notice: the listening client is behind a incus NAT in a incus container where the host server is the
public ip address.

Executed command

RUST_LOG=info ./dcutr-example --secret-key-seed 1 --mode listen --relay-address /ip4/10.162.235.39/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

Notice: this is my laptop running in my home network where there is a NAT and a basic firewall setup
in the gateway

Logs

p1r0@libp2pNode1:~/rust-libp2p-bare/relay-server-example/target/debug$ RUST_LOG=info ./dcutr-example --secret-key-seed 1 --mode listen --relay-address /ip4/10.162.235.39/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN
2024-09-17T08:37:15.173682Z  INFO libp2p_swarm: local_peer_id=12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-17T08:37:15.174558Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/tcp/36521
2024-09-17T08:37:15.174644Z  INFO dcutr_example: Listening on address address=/ip4/10.162.235.31/tcp/36521
2024-09-17T08:37:15.174892Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/udp/39912/quic-v1
2024-09-17T08:37:15.174989Z  INFO dcutr_example: Listening on address address=/ip4/10.162.235.31/udp/39912/quic-v1
2024-09-17T08:37:16.265139Z  INFO dcutr_example: Told relay its public address
2024-09-17T08:37:16.267471Z  INFO dcutr_example: Relay told us our observed address address=/ip4/10.162.235.31/tcp/36521
2024-09-17T08:37:16.315280Z  INFO dcutr_example: Relay accepted our reservation request
2024-09-17T08:37:16.315695Z  INFO dcutr_example: Listening on address address=/ip4/10.162.235.39/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-17T08:38:02.255853Z  INFO dcutr_example: event=InboundCircuitEstablished { src_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), limit: Some(Limit { duration: Some(120s), data_in_bytes: Some(131072) }) }
2024-09-17T08:38:02.488581Z  INFO dcutr_example: Established new connection peer=12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3 endpoint=Listener { local_addr: "/ip4/10.162.235.39/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit", send_back_addr: "/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3" }
2024-09-17T08:38:02.489372Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3") }
2024-09-17T08:38:02.772861Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 6b79c57e6a95239282c4818e96112f3f3a401ba97a564c23852a3f1ea5fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/127.0.0.1/tcp/42045", "/ip4/192.168.1.150/tcp/42045", "/ip4/127.0.0.1/udp/56226/quic-v1", "/ip4/192.168.122.1/udp/56226/quic-v1", "/ip4/192.168.1.150/udp/56226/quic-v1", "/ip4/192.168.122.1/tcp/42045"], protocols: ["/ipfs/ping/1.0.0", "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0", "/libp2p/dcutr"], observed_addr: "/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit" } }
2024-09-17T08:38:12.893833Z  INFO dcutr_example: Outgoing connection failed: Failed to negotiate transport protocol(s): [(/ip4/187.195.97.54/tcp/42045/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3: : Timeout has been reached)] peer=Some(PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"))
2024-09-17T08:38:23.472986Z  INFO dcutr_example: Outgoing connection failed: Failed to negotiate transport protocol(s): [(/ip4/187.195.97.54/tcp/42045/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3: : Timeout has been reached)] peer=Some(PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"))
2024-09-17T08:38:34.048308Z  INFO dcutr_example: Outgoing connection failed: Failed to negotiate transport protocol(s): [(/ip4/187.195.97.54/tcp/42045/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3: : Timeout has been reached)] peer=Some(PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"))
2024-09-17T08:38:34.048736Z  INFO dcutr_example: event=Event { remote_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), result: Err(Error { inner: AttemptsExceeded(3) }) }
2024-09-17T08:42:16.225777Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(1), peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN") }
2024-09-17T08:42:16.227835Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(1), peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 3b6a27bcceb6a42d62a3a8d02a6fd73653215771de243a63ac048a18b59da29) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/10.162.235.39/tcp/4001", "/ip4/127.0.0.1/udp/4001/quic-v1", "/ip4/66.29.128.144/tcp/4001", "/ip4/10.162.235.39/udp/4001/quic-v1", "/ip4/127.0.0.1/tcp/4001"], protocols: ["/ipfs/id/1.0.0", "/ipfs/ping/1.0.0", "/libp2p/circuit/relay/0.2.0/hop", "/ipfs/id/push/1.0.0"], observed_addr: "/ip4/10.162.235.31/tcp/36521" } }

Dialing Client

Multiaddress: /ip4/192.168.1.150/tcp/42045/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3

Executed command

RUST_LOG=info ./dcutr-example --secret-key-seed 2 --mode dial --relay-address /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6Xe4

Logs

└─(02:32:31 on relay-server-example)──> RUST_LOG=info ./dcutr-example --secret-key-seed 2 --mode dial --relay-address /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-17T08:32:43.043274Z  INFO libp2p_swarm: local_peer_id=12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3
2024-09-17T08:32:43.044208Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/tcp/42045
2024-09-17T08:32:43.044291Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.150/tcp/42045
2024-09-17T08:32:43.044358Z  INFO dcutr_example: Listening on address address=/ip4/192.168.122.1/tcp/42045
2024-09-17T08:32:43.044516Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/udp/56226/quic-v1
2024-09-17T08:32:43.044581Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.150/udp/56226/quic-v1
2024-09-17T08:32:43.044644Z  INFO dcutr_example: Listening on address address=/ip4/192.168.122.1/udp/56226/quic-v1
2024-09-17T08:32:44.860437Z  INFO dcutr_example: Told relay its public address
2024-09-17T08:32:44.862479Z  INFO dcutr_example: Relay told us our observed address address=/ip4/187.195.97.54/tcp/42045
2024-09-17T08:32:45.292991Z  INFO dcutr_example: event=OutboundCircuitEstablished { relay_peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN"), limit: Some(Limit { duration: Some(120s), data_in_bytes: Some(131072) }) }
2024-09-17T08:32:45.386709Z  INFO dcutr_example: Established new connection peer=12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X endpoint=Dialer { address: "/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X", role_override: Dialer, port_use: Reuse }
2024-09-17T08:32:45.684082Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
2024-09-17T08:32:45.686354Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): cecc157dc1ddd7295951c29888f095adb944d1b73d696e6df65d683bd4fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/10.162.235.31/udp/39912/quic-v1", "/ip4/10.162.235.31/tcp/36521", "/ip4/127.0.0.1/udp/39912/quic-v1", "/ip4/127.0.0.1/tcp/36521", "/ip4/10.162.235.39/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"], protocols: ["/ipfs/id/1.0.0", "/ipfs/ping/1.0.0", "/ipfs/id/push/1.0.0"], observed_addr: "/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3" } }
2024-09-17T08:32:56.045252Z  INFO dcutr_example: Outgoing connection failed: Failed to negotiate transport protocol(s): [(/ip4/10.162.235.31/tcp/36521/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X: : Timeout has been reached)] peer=Some(PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"))
2024-09-17T08:33:06.395826Z  INFO dcutr_example: Outgoing connection failed: Failed to negotiate transport protocol(s): [(/ip4/10.162.235.31/tcp/36521/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X: : Timeout has been reached)] peer=Some(PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"))
2024-09-17T08:33:16.971184Z  INFO dcutr_example: Outgoing connection failed: Failed to negotiate transport protocol(s): [(/ip4/10.162.235.31/tcp/36521/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X: : Timeout has been reached)] peer=Some(PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"))

Issue Considerations

I am not getting the tutorial logs in the dialing or listening clients some issues I could think of:

  1. the incus container in the NAT might not resolve properly the public IP since it is also its gateway (yet DNS resolves it)
  2. iptables configs for tcp forward has extra restrictions, yet the libp2p-lookup works.
  3. My LAN resolves mostly on ipv6
  4. code or sync issue.

Posible solutions

In case is network topology related:

  1. check upd with quic-v1
  2. Someone else has an network topology or environment to test this.
  3. Someone can help me using their own NAT and LAN so that we can verify without the incus container and incus NAT

Others:

  • Code or sync issue?

References/Sources

  1. https://docs.rs/libp2p/0.54.1/libp2p/tutorials/hole_punching/index.html
  2. Prefer tokio runtime everywhere #4449
  3. https://github.com/mxinden/libp2p-lookup

@jxs jxs changed the title refactor(examples): use tokio instead of async-std in relay-server [Code Review] refactor(examples): use tokio instead of async-std in relay-server Sep 17, 2024
Copy link
Member

@dariusc93 dariusc93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you format the example?

@dariusc93 dariusc93 self-requested a review September 19, 2024 00:26
@P1R
Copy link
Contributor Author

P1R commented Sep 20, 2024

UPDATE 1:

format added with cargo fmt.

UPDATE 2: testing with ../udp/4001/quic-v1/p2p..

Relay Server

Multiaddress: /ip4/66.29.128.144/udp/4001/quic-v1/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

Executed command

./relay-server-example --port 4001 --secret-key-seed 0

Notice: the relay server is running in an incus container where the iptables
of the main server with the public ip address redirect the 4001 tcp in bouth
directions (forwarding enable).

Logs

p1r0@libp2p:~/rust-libp2p-bare/relay-server-example/target/debug$ ./relay-server-example --port 4001 --secret-key-seed 0
Listening on "/ip4/127.0.0.1/tcp/4001"
Listening on "/ip4/10.162.235.39/tcp/4001"
Listening on "/ip4/127.0.0.1/udp/4001/quic-v1"
Listening on "/ip4/10.162.235.39/udp/4001/quic-v1"
BehaviourEvent: Sent { connection_id: ConnectionId(12), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
BehaviourEvent: Error { connection_id: ConnectionId(12), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), error: Timeout }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(12), result: Err(Other { error: Custom { kind: NotConnected, error: ConnectionLost(TimedOut) } }) }
BehaviourEvent: Sent { connection_id: ConnectionId(13), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
BehaviourEvent: Error { connection_id: ConnectionId(13), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), error: Timeout }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(13), result: Err(Other { error: Custom { kind: NotConnected, error: ConnectionLost(TimedOut) } }) }
BehaviourEvent: Sent { connection_id: ConnectionId(15), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3") }
BehaviourEvent: Received { connection_id: ConnectionId(15), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 6b79c57e6a95239282c4818e96112f3f3a401ba97a564c23852a3f1ea5fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/192.168.1.24/tcp/43971", "/ip4/127.0.0.1/tcp/43971", "/ip4/192.168.1.24/udp/60821/quic-v1", "/ip4/127.0.0.1/udp/60821/quic-v1"], protocols: ["/ipfs/id/1.0.0", "/ipfs/ping/1.0.0", "/ipfs/id/push/1.0.0", "/libp2p/circuit/relay/0.2.0/stop"], observed_addr: "/ip4/66.29.128.144/udp/4001/quic-v1" } }

Listening Client

Multiaddress: /ip4/10.162.235.39/udp/4001/quic-v1/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6Xe4

Notice: this time the client is running in a friend's LAN(NAT+Firewall )

Executed command

RUST_LOG=info ./dcutr-example --secret-key-seed 1 --mode listen --relay-address /ip4/66.29.128.144/udp/4001/quic-v1/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

Logs

ahgala@rustbox ~/r/r/t/debug (relay-server-example) [101]> RUST_LOG=info ./dcutr-example --secret-key-seed 1 --mode listen --relay-address /ip4/66.29.128.144/udp/4001/quic-v1/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN
2024-09-20T05:51:48.136817Z  INFO libp2p_swarm: local_peer_id=12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-20T05:51:48.138042Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/tcp/34795
2024-09-20T05:51:48.138127Z  INFO dcutr_example: Listening on address address=/ip4/10.160.42.179/tcp/34795
2024-09-20T05:51:48.138359Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/udp/44072/quic-v1
2024-09-20T05:51:48.138442Z  INFO dcutr_example: Listening on address address=/ip4/10.160.42.179/udp/44072/quic-v1
2024-09-20T05:51:49.377339Z  INFO dcutr_example: Relay told us our observed address address=/ip4/201.102.167.194/udp/44072/quic-v1
thread 'main' panicked at examples/dcutr/src/main.rs:165:26:
NewExternalAddrOfPeer { peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN"), address: "/ip4/10.162.235.39/udp/4001/quic-v1" }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Dialing Client

Multiaddress: /ip4/192.168.1.150/udp/4001/quic-v1/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3

Notice: this is my laptop running in my home network where there is a NAT and a basic firewall setup
in the gateway

Executed command

 RUST_LOG=info ./dcutr-example --secret-key-seed 2 --mode dial --relay-address /ip4/66.29.128.144/udp/4001/quic-v1/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X

Logs

┌─(...-libp2p-bare/relay-server-example/target/debug)───(p1r0@thoth:pts/4)─┐
└─(23:53:28 on relay-server-example)──> RUST_LOG=info ./dcutr-example --secret-key-seed 2 --mode dial --relay-address /ip4/66.29.128.144/udp/4001/quic-v1/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X

2024-09-20T05:53:44.435972Z  INFO libp2p_swarm: local_peer_id=12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3
2024-09-20T05:53:44.436691Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/tcp/43971
2024-09-20T05:53:44.436723Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.24/tcp/43971
2024-09-20T05:53:44.436803Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/udp/60821/quic-v1
2024-09-20T05:53:44.436829Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.24/udp/60821/quic-v1
2024-09-20T05:53:45.677762Z  INFO dcutr_example: Relay told us our observed address address=/ip4/138.84.62.18/udp/2268/quic-v1
thread 'main' panicked at examples/dcutr/src/main.rs:165:26:
NewExternalAddrOfPeer { peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN"), address: "/ip4/10.162.235.39/udp/4001/quic-v1" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Issue Considerations

Given the error on bouth peers:

 'main' panicked at examples/dcutr/src/main.rs:165:26:
NewExternalAddrOfPeer { peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN"), address: "/ip4/10.162.235.39/udp/4001/quic-v1" }

it seems that the line 164 is inside an block_on(Async as in using the futures block_on crate:

   23     block_on(async {
   22         let mut learned_observed_addr = false;
   21         let mut told_relay_observed_addr = false;
   20
   19         loop {
   18             match swarm.next().await.unwrap() {
   17                 SwarmEvent::NewListenAddr { .. } => {}
   16                 SwarmEvent::Dialing { .. } => {}
   15                 SwarmEvent::ConnectionEstablished { .. } => {}
   14                 SwarmEvent::Behaviour(BehaviourEvent::Ping(_)) => {}
   13                 SwarmEvent::Behaviour(BehaviourEvent::Identify(identify::Event::Sent {
   12                     ..
   11                 })) => {
   10                     tracing::info!("Told relay its public address");
    9                     told_relay_observed_addr = true;
    8                 }
    7                 SwarmEvent::Behaviour(BehaviourEvent::Identify(identify::Event::Received {
    6                     info: identify::Info { observed_addr, .. },
    5                     ..
    4                 })) => {
    3                     tracing::info!(address=%observed_addr, "Relay told us our observed address");
    2                     learned_observed_addr = true;
    1                 }
  165                 event => panic!("{event:?}"),
    1             }
    2
    3             if learned_observed_addr && told_relay_observed_addr {
    4                 break;
    5             }
    6         }
    7     });

NOTICE: In a previous call it was requested to remove this block_on section from the relay-server example

Could the issue be related to the block_on future not managed in the releay-server?

Posible solutions:

  1. Remove the block_on from futures from the dcutr-example code as the clients and do the tests again.

@P1R
Copy link
Contributor Author

P1R commented Sep 24, 2024

UPDATE 3: Retesting the whole punch with some changes on dcutr-example

Notice: block_on from futures where removed from the dcutr... yet I am not sure if it does the whole process (I require to understand dcutr further and debug the loops inside the tokio async function, just testing and documenting)

Relay Server

Multiaddress: /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

Executed command

./relay-server-example --port 4001 --secret-key-seed 0

Notice: the relay server is running in an incus container where the iptables
of the main server with the public ip address redirect the 4001 tcp in bouth
directions (forwarding enable) .
it also redirects the 4001 udp for the quic-v1

Logs

p1r0@libp2p:~/rust-libp2p-bare/relay-server-example/target/debug$ ./relay-server-example --port 4001 --secret-key-seed 0
Listening on "/ip4/127.0.0.1/tcp/4001"
Listening on "/ip4/10.162.235.39/tcp/4001"
Listening on "/ip4/127.0.0.1/udp/4001/quic-v1"
Listening on "/ip4/10.162.235.39/udp/4001/quic-v1"
BehaviourEvent: Sent { connection_id: ConnectionId(1), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
BehaviourEvent: Received { connection_id: ConnectionId(1), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): cecc157dc1ddd7295951c29888f095adb944d1b73d696e6df65d683bd4fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/192.168.122.1/udp/51997/quic-v1", "/ip4/192.168.1.23/udp/51997/quic-v1", "/ip4/192.168.1.23/tcp/34015", "/ip4/192.168.122.1/tcp/34015", "/ip4/127.0.0.1/tcp/34015", "/ip4/127.0.0.1/udp/51997/quic-v1"], protocols: ["/ipfs/id/push/1.0.0", "/libp2p/circuit/relay/0.2.0/stop", "/ipfs/id/1.0.0", "/ipfs/ping/1.0.0"], observed_addr: "/ip4/66.29.128.144/tcp/4001" } }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(186.89332ms) }
BehaviourEvent: ReservationReqAccepted { src_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), renewed: false }
BehaviourEvent: Sent { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3") }
BehaviourEvent: Received { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 6b79c57e6a95239282c4818e96112f3f3a401ba97a564c23852a3f1ea5fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/192.168.1.165/udp/57384/quic-v1", "/ip4/192.168.1.165/tcp/36199", "/ip4/127.0.0.1/udp/57384/quic-v1", "/ip4/127.0.0.1/tcp/36199"], protocols: ["/libp2p/circuit/relay/0.2.0/stop", "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0", "/ipfs/ping/1.0.0"], observed_addr: "/ip4/66.29.128.144/tcp/4001" } }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(162.240753ms) }
BehaviourEvent: CircuitReqAccepted { src_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), dst_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(155.51549ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(124.563906ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(124.452108ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(128.176112ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(108.157015ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(126.106238ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(202.87967ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(122.195224ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(109.240025ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(125.998096ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(173.713696ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(124.848002ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(120.624772ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), connection: ConnectionId(2), result: Ok(128.200104ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(186.692759ms) }
BehaviourEvent: CircuitClosed { src_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), dst_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), error: Some(Kind(TimedOut)) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(139.108973ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(112.638154ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(182.846162ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(105.296893ms) }
BehaviourEvent: Event { peer: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), connection: ConnectionId(1), result: Ok(178.216788ms) }

Listening Client

Multiaddress: /ip4/192.168.1.23/tcp/4001/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6Xe4

Public IP of gateway is 138.84.62.21

Notice: this time the client is running in a Starlink network LAN (NAT+Firewall )

Executed command

RUST_LOG=info ./dcutr-example --secret-key-seed 1 --mode listen --relay-address /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

Logs

┌─(~/Dev/git/libp2p/issue4449/rust-libp2p-bare/dcutr-example/target/debug)───────────────────────────────────────────────────────────────(p1r0@mew:pts/0)─┐
└─(21:04:09 on dcutr-example)──> RUST_LOG=info ./dcutr-example --secret-key-seed 1 --mode listen --relay-address /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN

2024-09-24T06:50:05.151826Z  INFO libp2p_swarm: local_peer_id=12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-24T06:50:05.152620Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/tcp/34015
2024-09-24T06:50:05.152691Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.23/tcp/34015
2024-09-24T06:50:05.152752Z  INFO dcutr_example: Listening on address address=/ip4/192.168.122.1/tcp/34015
2024-09-24T06:50:05.152929Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/udp/51997/quic-v1
2024-09-24T06:50:05.152992Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.23/udp/51997/quic-v1
2024-09-24T06:50:05.153052Z  INFO dcutr_example: Listening on address address=/ip4/192.168.122.1/udp/51997/quic-v1
2024-09-24T06:50:06.597423Z  INFO dcutr_example: Told relay its public address
2024-09-24T06:50:06.599805Z  INFO dcutr_example: Relay told us our observed address address=/ip4/138.84.62.21/tcp/53497
2024-09-24T06:50:06.885247Z  INFO dcutr_example: Relay accepted our reservation request
2024-09-24T06:50:06.885694Z  INFO dcutr_example: Listening on address address=/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-24T06:50:10.975529Z  INFO dcutr_example: event=InboundCircuitEstablished { src_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), limit: Some(Limit { duration: Some(120s), data_in_bytes: Some(131072) }) }
2024-09-24T06:50:11.627476Z  INFO dcutr_example: Established new connection peer=12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3 endpoint=Listener { local_addr: "/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit", send_back_addr: "/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3" }
2024-09-24T06:50:11.627986Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3") }
2024-09-24T06:50:12.171458Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 6b79c57e6a95239282c4818e96112f3f3a401ba97a564c23852a3f1ea5fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/192.168.1.165/tcp/36199", "/ip4/127.0.0.1/udp/57384/quic-v1", "/ip4/127.0.0.1/tcp/36199", "/ip4/192.168.1.165/udp/57384/quic-v1"], protocols: ["/ipfs/ping/1.0.0", "/ipfs/id/1.0.0", "/ipfs/id/push/1.0.0", "/libp2p/dcutr"], observed_addr: "/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit" } }
2024-09-24T06:50:12.597641Z  INFO dcutr_example: Established new connection peer=12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3 endpoint=Dialer { address: "/ip4/187.195.77.224/tcp/36199/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3", role_override: Listener, port_use: Reuse }
2024-09-24T06:50:12.597857Z  INFO dcutr_example: event=Event { remote_peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), result: Ok(ConnectionId(3)) }
2024-09-24T06:50:12.598704Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(3), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3") }
2024-09-24T06:50:12.659021Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(3), peer_id: PeerId("12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): 6b79c57e6a95239282c4818e96112f3f3a401ba97a564c23852a3f1ea5fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/127.0.0.1/udp/57384/quic-v1", "/ip4/192.168.1.165/udp/57384/quic-v1", "/ip4/127.0.0.1/tcp/36199", "/ip4/192.168.1.165/tcp/36199"], protocols: ["/ipfs/ping/1.0.0", "/ipfs/id/push/1.0.0", "/libp2p/circuit/relay/0.2.0/stop", "/ipfs/id/1.0.0"], observed_addr: "/ip4/138.84.62.21/tcp/53497" } }

Dialing Client

Multiaddress: /ip4/192.168.1.165/tcp/4001//p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3

Public IP of gateway is 187.195.77.224

Notice: it is my ISP provider and my PC.

Executed command

RUST_LOG=info ./dcutr-example --secret-key-seed 2 --mode dial --relay-address /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X

Logs

┌─(~/Dev/git/libp2p/issue4449/rust-libp2p-bare/dcutr-example/target/debug)─────────────────────────────────────────────────────────────(p1r0@thoth:pts/0)─┐
└─(00:45:28 on dcutr-example)──> RUST_LOG=info ./dcutr-example --secret-key-seed 2 --mode dial --relay-address /ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X
2024-09-24T06:49:53.431642Z  INFO libp2p_swarm: local_peer_id=12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3
2024-09-24T06:49:53.432352Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/tcp/36199
2024-09-24T06:49:53.432385Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.165/tcp/36199
2024-09-24T06:49:53.432459Z  INFO dcutr_example: Listening on address address=/ip4/127.0.0.1/udp/57384/quic-v1
2024-09-24T06:49:53.432485Z  INFO dcutr_example: Listening on address address=/ip4/192.168.1.165/udp/57384/quic-v1
2024-09-24T06:49:54.826035Z  INFO dcutr_example: Told relay its public address
2024-09-24T06:49:54.826377Z  INFO dcutr_example: Relay told us our observed address address=/ip4/187.195.77.224/tcp/36199
2024-09-24T06:49:55.250296Z  INFO dcutr_example: event=OutboundCircuitEstablished { relay_peer_id: PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN"), limit: Some(Limit { duration: Some(120s), data_in_bytes: Some(131072) }) }
2024-09-24T06:49:55.673866Z  INFO dcutr_example: Established new connection peer=12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X endpoint=Dialer { address: "/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X", role_override: Dialer, port_use: Reuse }
2024-09-24T06:49:56.070400Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
2024-09-24T06:49:56.070856Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(2), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): cecc157dc1ddd7295951c29888f095adb944d1b73d696e6df65d683bd4fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X", "/ip4/127.0.0.1/tcp/34015", "/ip4/192.168.122.1/udp/51997/quic-v1", "/ip4/192.168.122.1/tcp/34015", "/ip4/192.168.1.23/tcp/34015", "/ip4/127.0.0.1/udp/51997/quic-v1", "/ip4/192.168.1.23/udp/51997/quic-v1"], protocols: ["/ipfs/id/1.0.0", "/ipfs/ping/1.0.0", "/ipfs/id/push/1.0.0"], observed_addr: "/p2p/12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3" } }
2024-09-24T06:49:56.745621Z  INFO dcutr_example: Established new connection peer=12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X endpoint=Dialer { address: "/ip4/138.84.62.21/tcp/53497/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X", role_override: Dialer, port_use: Reuse }
2024-09-24T06:49:56.745690Z  INFO dcutr_example: event=Event { remote_peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), result: Ok(ConnectionId(3)) }
2024-09-24T06:49:56.843980Z  INFO dcutr_example: event=Sent { connection_id: ConnectionId(3), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X") }
2024-09-24T06:49:56.844322Z  INFO dcutr_example: event=Received { connection_id: ConnectionId(3), peer_id: PeerId("12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"), info: Info { public_key: PublicKey { publickey: Ed25519(PublicKey(compressed): cecc157dc1ddd7295951c29888f095adb944d1b73d696e6df65d683bd4fc) }, protocol_version: "/TODO/0.0.1", agent_version: "rust-libp2p/0.45.1", listen_addrs: ["/ip4/192.168.1.23/tcp/34015", "/ip4/192.168.122.1/tcp/34015", "/ip4/192.168.122.1/udp/51997/quic-v1", "/ip4/127.0.0.1/udp/51997/quic-v1", "/ip4/66.29.128.144/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X", "/ip4/127.0.0.1/tcp/34015", "/ip4/192.168.1.23/udp/51997/quic-v1"], protocols: ["/ipfs/id/1.0.0", "/ipfs/id/push/1.0.0", "/ipfs/ping/1.0.0", "/libp2p/circuit/relay/0.2.0/stop"], observed_addr: "/ip4/187.195.77.224/tcp/36199" } }

Issue Considerations

  1. Not sure if the whole punch was performed correctly but at least there is the information exchange and a connection and exchanged data.
  2. Unknown if the dcutr-example loops works async jumps to other what used to be futures block_on (async...
  3. I saw a connection with the circuit-relay server happen (perhaps someone did the verification ?)

Conclusions

It seems I require to study deeper dcutr code and verify my changes to the futures block_on, this was just an experimental process but require to understand more the protocol and debug the code.

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks David!

@jxs jxs added the send-it label Oct 4, 2024
@mergify mergify bot merged commit fcff3f8 into libp2p:master Oct 4, 2024
69 checks passed
sdbondi added a commit to sdbondi/rust-libp2p that referenced this pull request Nov 1, 2024
* master: (36 commits)
  chore: refactor ping tests (libp2p#5655)
  feat: refactor distributed-key-value-store example (libp2p#5652)
  chore(ci): address clippy beta lints (libp2p#5649)
  feat(gossipsub): apply `max_transmit_size` to the published message (libp2p#5642)
  feat(kad): add `Behavior::find_closest_local_peers()` (libp2p#5645)
  fix(swarm-test): set proper version (libp2p#5648)
  deps(ci): update cargo-semver-checks (libp2p#5647)
  chore: fix typo in comment (libp2p#5643)
  feat: make runtime features optional in swarm-test (libp2p#5551)
  deps: bump Swatinem/rust-cache from 2.7.3 to 2.7.5 (libp2p#5633)
  chore: update igd-next to 0.15.1 (libp2p#5625)
  fix(server): removing dependency on libp2p-lookup (libp2p#5610)
  refactor(examples): use tokio instead of async-std in relay-server (libp2p#5600)
  deps: update metrics example dependencies (libp2p#5617)
  chore: update interop test run condition (libp2p#5611)
  chore(autonat-v2): fix dial_back_to_non_libp2p test (libp2p#5621)
  fix(swarm): don't report `NewExternalAddrCandidate` if already confirmed (libp2p#5582)
  chore(ci): address beta clippy lints (libp2p#5606)
  fix(ci): address cargo-deny advisories (libp2p#5596)
  chore(ci): only run interop tests on commits to master (libp2p#5604)
  ...
mangolas added a commit to mangolas/rust-libp2p that referenced this pull request Jan 28, 2025
* Use newer version for rcgen enable RISC-V builds.

* Fix deprecation warnings for errors due to move to newer rcgen

* Fix rcgen version in webrtc

* chore: parameterise s3 build cache setup (libp2p#5586)

As we're setting up a new cache bucket, we'd like to be able to control
its' configuration via GitHub vars/secrets fully.

FYI, the secrets are not set up yet.

---------

Co-authored-by: João Oliveira <[email protected]>
Co-authored-by: Guillaume Michel <[email protected]>

* fix(autonat): reject inbound dial request from peer if its not connected (libp2p#5597)

## Description
As discovered and described in the issue below, there are situations
where an incoming AutoNAT dial can come from a non-connected peer.
However `resolve_inbound_request` expects that this situation cannot
occur. This PR adds a check upfront and refuses the incoming dial when
no connected peer is found.

Fixes libp2p#5570.
## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

Co-authored-by: João Oliveira <[email protected]>

* chore(ci): only run interop tests on commits to master (libp2p#5604)

## Description

This is done as temporary measure to unblock PR merging as the CI is
currently broken

Co-authored-by: Guillaume Michel <[email protected]>

* fix(ci): address cargo-deny advisories (libp2p#5596)

## Description
by updating:
- `bytes` to 1.7.1, `1.6.0` was
[yanked](https://crates.io/crates/bytes/1.6.0)
- `quinn-proto` to 0.11.8 to address
[RUSTSEC-2024-0373](https://rustsec.org/advisories/RUSTSEC-2024-0373.html)
- thirtyfour-macros to 0.1.11 to remove `proc-macro-error` dependency
and address
[RUSTSEC-2024-0370](https://rustsec.org/advisories/RUSTSEC-2024-0370.html)

* chore(ci): address beta clippy lints (libp2p#5606)

Co-authored-by: Darius Clark <[email protected]>

* fix(swarm): don't report `NewExternalAddrCandidate` if already confirmed (libp2p#5582)

## Description

Currently, `NewExternalAddrCandidate` events are emitted for every
connections. However, we continue to get this event even when `autonat`
has already confirmed that this address is external. So we should not
continue to advertise the "candidate" event.

## Notes & open questions

We have made the changes in the `swarm` instead of `identify` because it
does not make it necessary to duplicate the `ConfirmedExternalAddr`
vector in the `identify` Behaviour. Moreover, if any future Behaviour
emit `NewExternalAddrCandidate`, the same rule will also be applied.

I had to edit the `autonat_v2` tests which were always expecting a
`NewExternalAddrCandidate` but the address was already confirmed.

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: Darius Clark <[email protected]>
Co-authored-by: Guillaume Michel <[email protected]>

* chore(autonat-v2): fix dial_back_to_non_libp2p test (libp2p#5621)

## Description
By avoiding dialing an external address

Co-authored-by: Guillaume Michel <[email protected]>

* chore: update interop test run condition (libp2p#5611)

## Description

Follow up to libp2p#5604. Interop
tests only work on the main `rust-libp2p` repo, and not on forks,
because of the S3 cache (introduced in
libp2p#5586).

The interop tests currently don't run in the PRs, but they run after the
PRs are merged to `master`. This PR is trying to run interop tests in PR
that are branches of the main repo (not forks).

* deps: update metrics example dependencies (libp2p#5617)

## Description

and address cargo-deny
[RUSTSEC-2024-0376](https://rustsec.org/advisories/RUSTSEC-2024-0376.html)

* refactor(examples): use tokio instead of async-std in relay-server (libp2p#5600)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue libp2p#4449 
refactor: use tokio instead of async-std in the relay-servert example
and remove unnecessary dependencies
## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->
Fails on testing with the [whole punch
tutorial](https://docs.rs/libp2p/0.54.1/libp2p/tutorials/hole_punching/index.html)
possibly because of my networking topology. connection established event
registered.

I will publish the logs and testing information as a comment 

## Change checklist
* Removed unnecessary dependencies on examples/relay-server/Cargo.toml
* Updated tokio version  to "1.37.0"
<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: David E. Perez Negron R. <[email protected]>
Co-authored-by: Guillaume Michel <[email protected]>
Co-authored-by: João Oliveira <[email protected]>

* fix(server): removing dependency on libp2p-lookup (libp2p#5610)

## Description

Remove dependency on
[`libp2p-lookup`](https://github.com/mxinden/libp2p-lookup) which is no
longer maintained, and [makes checks
fail](https://github.com/libp2p/rust-libp2p/actions/runs/11016492372/job/30628121728).

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: João Oliveira <[email protected]>

* chore: update igd-next to 0.15.1 (libp2p#5625)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

Resolves libp2p#5506.

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

* deps: bump Swatinem/rust-cache from 2.7.3 to 2.7.5 (libp2p#5633)

Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from
2.7.3 to 2.7.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/swatinem/rust-cache/releases">Swatinem/rust-cache's
releases</a>.</em></p>
<blockquote>
<h2>v2.7.5</h2>
<h2>What's Changed</h2>
<ul>
<li>Upgrade checkout action from version 3 to 4 by <a
href="https://github.com/carsten-wenderdel"><code>@​carsten-wenderdel</code></a>
in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/190">Swatinem/rust-cache#190</a></li>
<li>fix: usage of <code>deprecated</code> version of <code>node</code>
by <a href="https://github.com/hamirmahal"><code>@​hamirmahal</code></a>
in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/197">Swatinem/rust-cache#197</a></li>
<li>Only run macOsWorkaround() on macOS by <a
href="https://github.com/heksesang"><code>@​heksesang</code></a> in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/206">Swatinem/rust-cache#206</a></li>
<li>Support Cargo.lock format cargo-lock v4 by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/211">Swatinem/rust-cache#211</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/carsten-wenderdel"><code>@​carsten-wenderdel</code></a>
made their first contribution in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/190">Swatinem/rust-cache#190</a></li>
<li><a
href="https://github.com/hamirmahal"><code>@​hamirmahal</code></a> made
their first contribution in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/197">Swatinem/rust-cache#197</a></li>
<li><a href="https://github.com/heksesang"><code>@​heksesang</code></a>
made their first contribution in <a
href="https://redirect.github.com/Swatinem/rust-cache/pull/206">Swatinem/rust-cache#206</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Swatinem/rust-cache/compare/v2.7.3...v2.7.5">https://github.com/Swatinem/rust-cache/compare/v2.7.3...v2.7.5</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/82a92a6e8fbeee089604da2575dc567ae9ddeaab"><code>82a92a6</code></a>
2.7.5</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/598fe25fa107b2fd526fc6471f6e48de7cd12083"><code>598fe25</code></a>
update dependencies, rebuild</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/8f842c2d455cfe3d0d5a4b28f53f5389b51b71bf"><code>8f842c2</code></a>
Support Cargo.lock format cargo-lock v4 (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/211">#211</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/96a8d65dbafbc7d145a9b2b6c3b12ee335738cd2"><code>96a8d65</code></a>
Only run macOsWorkaround() on macOS (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/206">#206</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/9bdad043e88c75890e36ad3bbc8d27f0090dd609"><code>9bdad04</code></a>
fix: usage of <code>deprecated</code> version of <code>node</code> (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/197">#197</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/f7a52f691454d93c6ce0dff6666a5cb399b8d06e"><code>f7a52f6</code></a>
&quot;add jsonpath test&quot;</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/2bceda39122b2cc71e6e26ad729b92b44d101f4b"><code>2bceda3</code></a>
&quot;update dependencies&quot;</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/640a22190e7a783d4c409684cea558f081f92012"><code>640a221</code></a>
Upgrade checkout action from version 3 to 4 (<a
href="https://redirect.github.com/swatinem/rust-cache/issues/190">#190</a>)</li>
<li><a
href="https://github.com/Swatinem/rust-cache/commit/158274163087d4d4d49dfcc6a39806493e413240"><code>1582741</code></a>
update dependencies</li>
<li>See full diff in <a
href="https://github.com/swatinem/rust-cache/compare/23bce251a8cd2ffc3c1075eaa2367cf899916d84...82a92a6e8fbeee089604da2575dc567ae9ddeaab">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Swatinem/rust-cache&package-manager=github_actions&previous-version=2.7.3&new-version=2.7.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: make runtime features optional in swarm-test (libp2p#5551)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

Sometimes a test uses custom swarm building logic and doesn't need `fn
new_ephemeral`, and sometimes a test uses `tokio` runtime other than
`async-std`.
This PR adds the `tokio` runtime support and makes both `async-std` and
`tokio` runtimes optional behind features to make it more flexible.

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: João Oliveira <[email protected]>

* chore: fix typo in comment (libp2p#5643)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates

* deps(ci): update cargo-semver-checks (libp2p#5647)

* fix(swarm-test): set proper version (libp2p#5648)

## Description
To unblock  CI

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* feat(kad): add `Behavior::find_closest_local_peers()` (libp2p#5645)

## Description

Fixes libp2p#5626

## Notes & open questions

This is the nicest way I came up with, I decided to leave
`get_closest_local_peers` as is since it does return all peers, not just
`replication_factor` peers.

Looking at libp2p#2436 it is not
clear if @folex really needed all peers returned or it just happened
that way. I'm also happy to change proposed API to return all peers if
that is preferred by others.

It is very unfortunate that `&mut self` is needed for this, I created
libp2p#5644 that if resolved will
allow to have `&self` instead.

## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

Co-authored-by: João Oliveira <[email protected]>

* feat(gossipsub): apply `max_transmit_size` to the published message (libp2p#5642)

## Description

When trying to publish a message using gossipsub's `publish` method,
it should be possible to predict whether it will fit in the limit
defined by
the `max_transmit_size` config option.
If this limit applies to the final protobuf payload, it's not possible
to know
that in advance because the size of the added fields is not fixed.

This change makes the limit apply to the passed message size instead of
the final wire size.

## Notes & open questions

This is a minor version change because it changes the meaning of the
existing config option.
However, for the existing clients the limit will only become more
permissive, so it shouldn't break anything.

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: Darius Clark <[email protected]>
Co-authored-by: João Oliveira <[email protected]>

* chore(ci): address clippy beta lints (libp2p#5649)

Co-authored-by: Darius Clark <[email protected]>

* feat: refactor distributed-key-value-store example (libp2p#5652)

## Description

ref libp2p#4449 

Refactored distributed-key-value-store example to use `tokio` instead of
`async-std`

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

* chore: refactor ping tests (libp2p#5655)

## Description

ref libp2p#4449 

Refactored ping tests to use `tokio` instead of `async-std`.

## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

* fix(websocket): don't dial `/dnsaddr` addresses (libp2p#5613)

## Description

Returns `Error::InvalidMultiaddr` when `parse_ws_dial_addr` is called
with `/dnsaddr`.

As per its specification, `/dnsaddr` domains are not meant to be
directly dialed, instead it should be appended with `_dnsaddr.` and used
for DNS lookups afterwards

Related: libp2p#5529
Fixes: libp2p#5601 

## Notes & open questions

* Is it okay to return an error, or should I perform a DNS lookup and
resolve that DNS afterwards if address has `/dnsaddr`?
* If so, how should I handle that case where DNS lookup returns multiple
multiaddrs?

## Change checklist

- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: Darius Clark <[email protected]>

* chore: fix some comments (libp2p#5661)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* chore: identify::Config fields private (libp2p#5663)

## Description

Closes libp2p#5660 

## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

* chore(protocols): fix some typos in comment (libp2p#5665)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

fix some typos in comment



## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates

Signed-off-by: wangjingcun <[email protected]>

* chore(ci): fix interop tests region, and run them again on each PR (libp2p#5666)

* chore: deprecate `void` crate (libp2p#5676)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

The `void` crate provides a `Void` type that is conceptually equivalent
to the [`never`
type(!)](https://doc.rust-lang.org/std/primitive.never.html). This PR
tries to remove `void` crate from the dependency tree by replacing
`void::Void` with
[`std::convert::Infallible`](https://doc.rust-lang.org/std/convert/enum.Infallible.html)
that will eventually become an alias of the `never` type(!)

> This enum has the same role as [the ! “never”
type](https://doc.rust-lang.org/std/primitive.never.html), which is
unstable in this version of Rust. When ! is stabilized, we plan to make
Infallible a type alias to it:

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] A changelog entry has been made in the appropriate crates

* chore: replace async-std with tokio in autonat tests (libp2p#5671)

## Description

ref libp2p#4449 

Refactored `autonat` tests to use `tokio` instead of `async-std`.

* chore: bump crate versions and update changelogs for libp2p#5676 (libp2p#5678)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->

This PR bumps crate versions and add changelog entries for crates that
are changed in libp2p#5676

Question: When should a crate version bump in the current release
process? Should it be right before or right after publishing? I see most
of current crate versions are published while some are not (e.g.
[email protected] [email protected] and [email protected] etc.)

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates

---------

Co-authored-by: João Oliveira <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* chore(ci): add a mergify batch queue for external PRs (libp2p#5668)

and remove the if conditions no longer required as we are running them
again on every PR

---------

Co-authored-by: Guillaume Michel <[email protected]>
Co-authored-by: João Oliveira <jxs>

* chore: refactor dcutr and gossipsub tests to use tokio instead

ref libp2p#4449

Refactored dcutr and gossipsub tests to use `tokio` instead of `async-std`.

Pull-Request: libp2p#5662.

* chore(gossispsub): deprecate futures-ticker

to address [RUSTSEC-2024-0384 ](https://rustsec.org/advisories/RUSTSEC-2024-0384.html). Use `futures-timer` and `Delay` instead

Pull-Request: libp2p#5674.

* chore: update FUNDING.json

I've added addresses to receive Drips donations. This is required for FIL-RetroPGF-2 in the coming days, we should get this into `master` ASAP.

This is a dedicated address controlled by Sigma Prime (including @AgeManning and myself).

Pull-Request: libp2p#5685.

* feat(gossipsub): introduce backpressure

superseeds libp2p#4914 with some changes and improvements, namely:

- introduce a `Delay` for `Forward` and `Publish` messages, messages that take more than the configured delay to be sent are discarded
- introduce scoring and penalize slow peers
- remove control pool
- report slow peers with the number of failed messages

Pull-Request: libp2p#5595.

* chore(deps): upgrade `thiserror` to 2.0

Changes:
- upgrade `thiserror` crate from `1` to `2`
- move `thiserror` to `workspace.dependencies`
- sort `workspace.dependencies`
- ~run `cargo update` to update `Cargo.lock`~
(Skipping changelog as `thiserror` does not present in any public APIs)

Pull-Request: libp2p#5689.

* fix: typos in documentation files

Pull-Request: libp2p#5693.

* fix(gossipsub): fix mesh/fanout inconsistencies

When a peer unsubscribes also remove it from fanout.

Pull-Request: libp2p#5690.

* fix(ci): Clippy Beta

Fixes CI failure in Clippy (Beta)

https://github.com/libp2p/rust-libp2p/actions/runs/12055058396/job/33614543029

Pull-Request: libp2p#5700.

* chore: introduce rustfmt.toml

Pull-Request: libp2p#5695.

* feat(kad): make Distance private field public

make Distance private field (U256) public

So that some `network density` in Distance can be calculated as below:

```rust
let density = U256::MAX / U256::from(estimated_network_size);
let density_distance = Distance(estimated_distance);
```

Pull-Request: libp2p#5705.

* chore: fix some typos in comment

fix some typos in comment

Pull-Request: libp2p#5721.

* fix(libp2p): expose builder phase error

May close libp2p#4829 and libp2p#4824.
Export three error types `BehaviourError`, `TransportError`, `WebsocketError` with rename. Feature gated `WebsocketError`.
Exported at crate root as [suggested](libp2p#4824 (comment)).

Pull-Request: libp2p#5726.

* feat(request-response): Add connection id to behaviour events

Closes libp2p#5716.

Added connection id to the events emitted by a request-response Behaviour and adapted the code accordingly.

Pull-Request: libp2p#5719.

* chore(ci): update Rust stable version

Update Rust stable version in our CI to the latest stable version 1.83.0.

Pull-Request: libp2p#5730.

* chore(roadmap): fix typo

Pull-Request: libp2p#5732.

* chore(deps): upgrade uint to 0.10

This PR upgrade `uint` to `0.10`
https://github.com/paritytech/parity-common/blob/master/uint/CHANGELOG.md#0100---2024-09-11
(Skipping changelog as there's no changes in public APIs)

Pull-Request: libp2p#5699.

* fix: RUSTSEC-2024-0421 by upgrading idna

https://rustsec.org/advisories/RUSTSEC-2024-0421.html

Pull-Request: libp2p#5727.

* deps(metrics-example): update opentelemetry to 0.27

this will help fix the `cargo deny` situation as `opentelemetry-otlp` `0.25` has `tokio` [locked to `~1.38.0`](https://crates.io/crates/opentelemetry-otlp/0.25.0/dependencies) 🤷‍♂️
which then impedes us tfrom updating `netlink-sys`

Pull-Request: libp2p#5735.

* fix: update Cargo.lock

To finally address [RUSTSEC-2024-0384](https://rustsec.org/advisories/RUSTSEC-2024-0384).
Thanks  @hanabi1224 for submitting the [upstream update](rust-netlink/netlink-sys#25) ❤️

Pull-Request: libp2p#5737.

* chore: add Unicode V3 license to deny.toml

Add `Unicode` `v3` License to our `cargo.deny` file.
This is required because of the [`icu_collections`](https://crates.io/crates/icu_collections) dependency which is authored by The Unicode Consortium.
in my ignorance, seems to be safe as the Open Source Initiative [approves it](https://opensource.org/license/unicode-license-v3), and the main `deny.toml` has also [added it](https://github.com/EmbarkStudios/cargo-deny/pull/713/files#diff-1040309c64844eb1b6b63d8fd67938adbf9461f1b3c61f12cf738f064a02d3deR50).

Pull-Request: libp2p#5738.

* chore(core): avoid unused props matching on connection.rs

Pull-Request: libp2p#5734.

* feat(swarm): set default for idle-connection-timeout to 10s (libp2p#4967)

## Description

With the move to a global idle-connection-timeout, connections are being
closed much more aggressively. This causes problems in situations where,
e.g. an application wants to use a connection shortly after an event has
been emitted from the `Swarm`. With a default of 0 seconds, such a
connection is instantly considered idle and therefore closed, despite
the application wanting to use it again just moments later. Whilst it is
possible to structure application code to mitigate this, it is
unnecessarily complicated.

Additionally, connections being closed instantly if not in use is a
foot-gun for newcomers to the library.

From a technical point-of-view, instantly closing idle connections is
nice. In reality, it is an impractical default. Hence, we change this
default to 10s.

10 seconds is considered to be an acceptable default as it strikes a
balance between allowing some pause between network activity, yet frees
up resources that are (supposedly) no longer needed.

Resolves: libp2p#4912.

* chore(deps): bump golang.org/x/crypto from 0.21.0 to 0.31.0 (libp2p#5736)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from
0.21.0 to 0.31.0. for the wasm webtransport tests

* fix(identify): validate public key from remote peer

Related libp2p#5706

Discard `Info` messages received from a remote peer that contain a public key that doesn't match their peer ID, and log a warning. Don't emit `identify::Received` events to the swarm containing whatever public key they sent.

Pull-Request: libp2p#5707.

* deps(memory-connection-limits): update sysinfo to 0.33

Pull-Request: libp2p#5739.

* feat(SwarmBuilder): add with_connection_timeout method

Small PR to be able to change the `connection_timeout` value given to the `TransportTimeout` when building the `Swarm` with a `SwarmBuilder`.

Pull-Request: libp2p#5575.

* chore(core): use `matches!` in connection.rs

Pull-Request: libp2p#5740.

* chore: fix format with nightly

Fix formatting with nightly.

Without nightly, some of our `rustfmt.toml` rules aren't applied because they are not stable yet (e.g. our `group_imports` rule).
Our CI didn't catch it yet because it doesn't check fmt on nightly. Will fix that in a follow-up PR.

Pull-Request: libp2p#5742.

* chore(docs): fix typos in documentation

Pull-Request: libp2p#5744.

* chore(ci): check rustfmt with nightly toolchain

Some of our rustfmt rules aren't stable yet. Thus our rustfmt CI check should run on nightly.

Pull-Request: libp2p#5743.

* fix(kad): improve memory allocation when iterating over kbuckets

Proposal to fix libp2p#5712.

I have changed to `ClosestIter` structure to only allocate when `kbucket_size` is higher than `K_VALUE` and only once along the life of `ClosestIter`. I think I did not break anything but I would really like some experienced people with Kademlia to take a look (@guillaumemichel 😉).

Pull-Request: libp2p#5715.

* chore(spellchecker): fix typos in comment

- use spellchecker, and check false positive manually

```
codespell  -L crate,COMIT,comit  -S CHANGELOG.md
```
- maybe we can add typo checker in github action ref: https://github.com/codespell-project/actions-codespell

Pull-Request: libp2p#5750.

* chore: add SQD Network to notable users list

SQD Network uses Libp2p and gossipsub protocol in particular to organize a decentralized network of p2p workers that provide fast access to stored data.

Pull-Request: libp2p#5749.

* feat(mdns): emit `ToSwarm::NewExternalAddrOfPeer` on discovery

fixes libp2p#5104 and superseeds libp2p#5179

Pull-Request: libp2p#5753.

* fix: multiple typos of different importance

This pull request addresses several typos and minor grammatical inconsistencies found across multiple files in the repository. The fixes aim to improve clarity, readability, and maintain consistency in the project's documentation and workflows.

### Key Changes:
- **`.github/ISSUE_TEMPLATE/bug_report.yml`**:
- Fixed grammatical issues in descriptions and labels.
- **`.github/ISSUE_TEMPLATE/enhancement.yml`**:
- Corrected label text and standardized phrasing.
- **`.github/ISSUE_TEMPLATE/feature_request.yml`**:
- Improved label consistency and readability.
- **`.github/pull_request_template.md`**:
- Enhanced phrasing and corrected minor grammatical errors.
- **`.github/workflows/ci.yml`**:
- Adjusted text to ensure consistent phrasing and clarity in workflow steps.

These updates ensure a more professional and coherent presentation across the project documentation and workflows.

Pull-Request: libp2p#5756.

* chore(deps): remove unused deps

Remove unused dependencies

(Not sure how to bump `libp2p-identity` and `libp2p-swarm-derive` versions in a PR)

Pull-Request: libp2p#5747.

* chore(mdns): revert version bump

Revert version bump of libp2p#5753, because libp2p-mdns-0.46.1 isn't released yet.

Pull-Request: libp2p#5762.

* deps(quic): update quinn to 0.11.6

Among other changes, it includes a fix for this issue which often reproduces with libp2p: quinn-rs/quinn#1889

Pull-Request: libp2p#5757.

* chore: introduce `libp2p-test-utils`

Fixes libp2p#4992

Based on the conversation in libp2p#4992.

Pull-Request: libp2p#5725.

* feat(gossipsub): implement gossipsub 1.2 beta

This PR implements gossipsub 1.2 beta bringing changes over from lighthouse
ref PR: sigp/lighthouse#5422

Please include any relevant issues in here, for example:
libp2p/specs#548

Pull-Request: libp2p#5697.

* chore(deps): update Cargo.lock

- run `cargo update`
- lock `webrtc-ice = "=0.10.0"` to not break webrtc smoke tests
- fix `cargo clippy` warnings
- update `deny.toml` accordingly

Pull-Request: libp2p#5755.

* feat(gossipsub): Allow setting a size threshold for IDONTWANT messages

This PR adds configurable parameter that sets minimum message size for which `IDONTWANT` messages would be send. This is an optimisation trick, discussion regarding the same can be found [here](sigp/lighthouse#6437)

Pull-Request: libp2p#5770.

* chore(kad): revert version bump

Revert version bump, because `libp2p-kad-0.47.0` isn't released yet.

Pull-Request: libp2p#5776.

* chore(autonat): revert version bump

Revert version bump, `libp2p-autonat-v0.13.1` isn't released yet.

Pull-Request: libp2p#5777.

* chore(server): revert version bump

Revert version bump, `libp2p-server-v0.12.6` isn't released yet.

Pull-Request: libp2p#5780.

* chore(identify): revert version bump

Revert version bump, `libp2p-identify-v0.46.0` isn't released yet.

Pull-Request: libp2p#5778.

* chore(ci): add Zlib to deny.toml

Similar to libp2p#5738,  [`foldhash`](https://crates.io/crates/foldhash) is the dependency that requires it. It was introduced by `hashbrown` which is dependency of a lot of crates [here](rust-lang/hashbrown#563).
`hashbrown` is MIT, and Zlib is also an Open Source Initiative [approved license](https://opensource.org/license/zlib).

If you prefer we can also do as the upstream `cargo-deny` do and just add `foldhash` [to the exceptions](https://github.com/EmbarkStudios/cargo-deny/pull/618/files#diff-1040309c64844eb1b6b63d8fd67938adbf9461f1b3c61f12cf738f064a02d3deR56) but I can't see any advantage to it.
Cc @hanabi1224

Pull-Request: libp2p#5769.

* chore(allow-block-list): revert version bump

Revert version bump, `libp2p-allow-block-list-v0.4.1` isn't released yet.

Pull-Request: libp2p#5779.

* chore(kad): remove default constructor for ProtocolConfig

Remove items that were deprecated in libp2p#5122.

Pull-Request: libp2p#5774.

* feat: broadcasting `idontwant` for published messages

This PR introduces an optimisation to preemptively broadcast `IDONTWANT` for published messages, preventing redundant downloads of the same message received over gossip. This feature is opt-in and respects the existing `idontwant_message_size_threshold`. By default, `IDONTWANT` messages will only be sent for published messages larger than 1000 bytes.

reference PRs:
[spec](libp2p/specs#642)

Pull-Request: libp2p#5773.

* fix(gossipsub): make sure we have fanout peers when publish

This PR is to submit a fix in Lighthouse. sigp/lighthouse#6738

An `InsufficientPeers` error can occur under a particular condition, even if we have peers subscribed to a topic.

Pull-Request: libp2p#5793.

* feat(request-response): allow custom sizes for `json` and `cbor` codec

resolves libp2p#5791.

Pull-Request: libp2p#5792.

* chore: update MSRV

Pull-Request: libp2p#5650.

* chore: address clippy lints for Rust 1.85.0-beta

Pull-Request: libp2p#5802.

* deps: bump Swatinem/rust-cache from 2.7.5 to 2.7.7

Pull-Request: libp2p#5775.

* refactor: mark {In, Out}boundOpenInfo as deprecated

Mark `{In, Out}boundOpenInfo` as deprecated.
May close libp2p#3268.

Pull-Request: libp2p#5242.

* chore(identify): fix changelog entry

Amendment to libp2p#5778.

Merged CHANGELOG entries of `0.45.1` and `0.46.0`. Version `0.45.1` has been superseded by `0.46.0` before it was released.

Pull-Request: libp2p#5803.

* update webrtc crate

* update CHANGELOG.md

* fix websocket doc

* chore(ci): fix wasm tests

see here rust-lang/compiler-team#607 for more info

Pull-Request: libp2p#5805.

* chore(swarm): append missing changelog

Add missing changelog entry for libp2p#5242.

Pull-Request: libp2p#5806.

* ci(mergify): upgrade configuration to current format

Pull-Request: libp2p#5683.

* fix(tcp): make `TCP_NODELAY` actually the default

Nagle's algorithm is actually disabled by setting `TCP_NODELAY` to _true_. In the current master, it is set to _false_, i.e. Nagle's algorithm is enabled.
This PR sets `TCP_NODELAY` per default to `true` and fixes the description of `tcp::Config::new`.

Fixes libp2p#4890.

Pull-Request: libp2p#5764.

* chore(ci): update mergify script

With libp2p#5683  the automatically merge of `send-it` labeled PR's was lost.
This PR brings it back

Pull-Request: libp2p#5808.

* chore(interop-tests): remove static linking flags for dependency builds

When building the dependencies, we are not linking anything so we don't need to specify the static linking flags.

Pull-Request: libp2p#5121.

* deps(if-watch): update if-watch to v3.2.1

Bumps the `if-watch` version to 3.2.1, aiming to fix libp2p#5628.

Since this [`if-watch` PR](libp2p/if-watch#37), the `system-configuration` version has been updated, which enables compiling for iOS targets.

Pull-Request: libp2p#5758.

* chore(ci): update mergify script

missed this, with this dependabot is not able to merge PR's by itself as it needs the `send-it` label.
also add a clause for the dismiss of stale approvals to not do so when the last commit was done by one of the `rust-libp2p` maintainers, so that we don't dismiss approvals if the last commit was a merge of master into the PR that is necessary before merging the PR.
Latest example of this happening [here](libp2p#5758 (comment))

Pull-Request: libp2p#5809.

* chore(test-utils): revert libp2p#5725

We cannot publish the crates using `libp2p-test-utils`, as cargo seems to required `dev-dependencies` to also be published

Pull-Request: libp2p#5810.

* fix: minor version bump packages affected by libp2p#5676

By switching from `void::Void` to `std::convert::Infallible`, libp2p#5676 changed the output types of some `NetworkBehavior` implementations in different protocols.
This can cause a type mismatch for the user and therefore is a breaking change.

libp2p#5678 (follow-up PR that version-bumped the crates affected by libp2p#5676) only bumped the patch version of the affected crates.
The current PR now changes it to a minor version bump for all crates where types in a `NetworkBehavior` implementation were affected.

It also reverts the version bump and CHANGELOG entry in `libp2p-quic` that was added with libp2p#5678, because that crate was never touched by the original PR.

Pull-Request: libp2p#5811.

* chore: prepare libp2p-webrtc-websys 0.4.0

Pull-Request: libp2p#5807.

* chore(*): prepare release

Bump minor version of all crates that depend on `libp2p-core`, to avoid conflicting versions or `libp2p-core` being pulled in multiple times.

Pull-Request: libp2p#5813.

* chore(ci): fix workspace version enforcing job

Cue due to an [update](https://crates.io/crates/tomlq/0.2.0) to the `tomlq` tool, there's now a mismatch between the `$CRATE_VERSION` and the  `$SPECIFIED_VERSION` variables:
```bash
Package version: 0.43.0
Specified version: "0.43.0"
```
This PR attempts to fix the "Enforce version in `workspace.dependencies` matches the latest version" job by locking to the previous version until (and if) the situation is solved.
Also see cryptaliagy/tomlq#22

Pull-Request: libp2p#5817.

* refactor(gossipsub): remove duplicated call to `inbound_transform`

May close libp2p#4369.

Pull-Request: libp2p#5767.

* chore(ci): update tomlq

and address the version lock introduced on libp2p#5817

Pull-Request: libp2p#5821.

* WIP allow test runs manually

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: wangjingcun <[email protected]>
Co-authored-by: haurog <[email protected]>
Co-authored-by: Piotr Galar <[email protected]>
Co-authored-by: João Oliveira <[email protected]>
Co-authored-by: Guillaume Michel <[email protected]>
Co-authored-by: Stefan <[email protected]>
Co-authored-by: Darius Clark <[email protected]>
Co-authored-by: stormshield-frb <[email protected]>
Co-authored-by: P1R0 <[email protected]>
Co-authored-by: David E. Perez Negron R. <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hanabi1224 <[email protected]>
Co-authored-by: yanziseeker <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Nazar Mokrynskyi <[email protected]>
Co-authored-by: Dzmitry Kalabuk <[email protected]>
Co-authored-by: Krishang Shah <[email protected]>
Co-authored-by: Hamza <[email protected]>
Co-authored-by: wangjingcun <[email protected]>
Co-authored-by: Paul Hauner <[email protected]>
Co-authored-by: leopardracer <[email protected]>
Co-authored-by: maqi <[email protected]>
Co-authored-by: needsure <[email protected]>
Co-authored-by: DrHuangMHT <[email protected]>
Co-authored-by: Bastien Faivre <[email protected]>
Co-authored-by: Elena Frank <[email protected]>
Co-authored-by: lfg2 <[email protected]>
Co-authored-by: Sergey Melnychuk <[email protected]>
Co-authored-by: Thomas Eizinger <[email protected]>
Co-authored-by: James Hiew <[email protected]>
Co-authored-by: X6 <[email protected]>
Co-authored-by: Tristav <[email protected]>
Co-authored-by: argentpapa <[email protected]>
Co-authored-by: Dzmitry Kalabuk <[email protected]>
Co-authored-by: hopinheimer <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Akihito Nakano <[email protected]>
Co-authored-by: Breno Teodoro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants